#include "MysqlMgr.h"

MysqlMgr::~MysqlMgr() {
}
int MysqlMgr::RegUser(const std::string& name, const std::string& email, const std::string& pwd)
{
    return _dao.RegUser(name, email, pwd);
}

bool MysqlMgr::CheckEmail(const std::string& name, const std::string& email)
{
    return _dao.CheckEmail(name, email);
}

bool MysqlMgr::UpdataPwd(const std::string& name, const std::string& pwd)
{
    return _dao.UpdataPwd(name, pwd);
}

bool MysqlMgr::CheckPwd(const std::string& name, const std::string& pwd, UserInfo& userInfo)
{
    return _dao.CheckPwd(name, pwd, userInfo);
}
bool MysqlMgr::AddFriendApply(const int& fromuid, const int& touid)
{
    return _dao.AddFriendApply(fromuid,touid);
}
bool MysqlMgr::GetApplyList(int touid, std::vector<std::shared_ptr<ApplyInfo>>& applyList, int begin, int limit)
{
    return _dao.GetApplyList(touid,applyList,begin,limit);
}
std::shared_ptr<UserInfo> MysqlMgr::GetUser(int uid)
{
    return _dao.GetUser(uid);
}

std::shared_ptr<UserInfo> MysqlMgr::GetUser(const std::string& name)
{
    return _dao.GetUser(name);
}

void MysqlMgr::AuthFriendApply(int uid, int touid)
{
    return _dao.AuthFriendApply(uid,touid);
}

void MysqlMgr::AppendFriendInfo(int uid, int touid, std::string& name)
{
    return _dao.AppendFriendInfo(uid,touid,name);
}

bool MysqlMgr::GetFriendList(int self_id, std::vector<std::shared_ptr<UserInfo>>& user_list)
{
    return _dao.GetFriendList(self_id,user_list);
}

MysqlMgr::MysqlMgr() {
}